home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 24 November 1998
- //
- // Description:
- // This script initializes the Attribute Editor.
- //
-
- global proc showAttributeEditor(int $show)
- //
- // Description:
- //
- // *** Obsolete ***
- //
- // *** Use runTimeCommand ToggleAttributeEditor instead ***
- //
- // Arguments:
- // show - True if the Attribute Editor should be shown, false if the
- // Attribute Editor should become hidden.
- //
- {
- warning -showLineNumber true
- ("The procedure \"showAttributeEditor()\" is now obsolete. "
- + "Use the command \"ToggleAttributeEditor\" instead.");
- }
-
- global proc int attributeEditorVisibilityStateChange(
- int $newState,
- string $layout)
- //
- // Description:
- // This procedure is called whenever the visibility state of the
- // Attribute Editor is changed.
- //
- // Arguments:
- // newState - The new visibile state of the Attribute Editor.
- //
- // layout - The parent layout for the Attribute Editor.
- //
- // Returns:
- // true - If the change of state is to be allowed.
- //
- // false - If the state change is rejected.
- //
- {
- global string $gAttributeEditorForm;
- global int $gAutoUpdateAttrEdFlag;
- global int $gIgnoreAEUpdate;
-
- string $children[], $attributeEditorForm;
- int $count = `layout -query -numberOfChildren $gAttributeEditorForm`;
- int $result = true;
-
- if ($newState) {
- //
- // Delete the Attribute Editor window if necessary.
- //
- if (`window -exists AEWindow`) {
- deleteUI -window AEWindow;
- }
-
- if (0 == $count) {
- //
- // Need to create the Attribute Editor controls.
- //
- $attributeEditorForm = `formLayout
- -parent $gAttributeEditorForm
- `;
- createAEWindowContents $attributeEditorForm "" auto;
-
- // Get the child of the formLayout, and perform the
- // appropriate attachments for the AE formLayout.
- //
- $children = `formLayout -query -childArray
- $attributeEditorForm`;
-
- formLayout -edit
- -attachForm $children[0] "top" 0
- -attachForm $children[0] "left" 0
- -attachForm $children[0] "bottom" 0
- -attachForm $children[0] "right" 0
- $attributeEditorForm;
-
- // Attach Attribute Editor to parent.
- //
- formLayout -edit
- -attachForm $attributeEditorForm "top" 0
- -attachForm $attributeEditorForm "left" 0
- -attachForm $attributeEditorForm "bottom" 0
- -attachForm $attributeEditorForm "right" 0
- $gAttributeEditorForm;
-
- // Force a refresh with the lead object
- //
- string $selected[] = `ls -selection -tail 1`;
- updateAE $selected[0];
- }
-
- // if the AE is in auto mode, update it.
- //
- if ($gAutoUpdateAttrEdFlag && !$gIgnoreAEUpdate) {
- evalDeferred("autoUpdateAttrEd");
- }
- $result = true;
-
- } else {
- $result = true;
- }
-
- // Defer these commands because this proc is called when the visibility
- // state is about to change. This proc must return true to accept
- // the state change. After this proc returns then restore the
- // panel focus and update the pref menu.
- //
- evalDeferred("restoreLastPanelWithFocus();updatePrefsMenu();");
-
- return $result;
- }
-
- {
- source showEditor;
-
- // Declare referenced or returned variables
- //
- global string $gAttributeEditorForm;
-
- // Determine values of option variables
-
- int $attributeEditorVisible = `optionVar -query isAttributeEditorVisible`;
-
- // Create a layout appropriate for the Attribute Editor.
- //
- string $attributeEditorForm = `formLayout -parent $gAttributeEditorForm`;
-
- // Create the contents of the Attribute Editor.
- //
- createAEWindowContents $attributeEditorForm "" auto;
-
- // Get the child of the formLayout, and perform the
- // appropriate attachments for the AE formLayout
- //
- string $children[] = `formLayout -query -childArray $attributeEditorForm`;
-
- formLayout -edit
- -attachForm $children[0] "top" 0
- -attachForm $children[0] "left" 0
- -attachForm $children[0] "bottom" 0
- -attachForm $children[0] "right" 0
- $attributeEditorForm;
-
- // Attach Attribute Editor to parent.
- //
- int $offset = 3;
- if (`about -mac`) {
- $offset = 3;
- }
- formLayout -edit
- -attachForm $attributeEditorForm "top" $offset // to make the menus line up
- -attachForm $attributeEditorForm "left" 0
- -attachForm $attributeEditorForm "bottom" 0
- -attachForm $attributeEditorForm "right" 0
- $gAttributeEditorForm;
-
- setUIComponentStateCallback(
- "Attribute Editor", "attributeEditorVisibilityStateChange");
-
- // Set the visibility of the Attribute Editor.
- //
- setAttributeEditorVisible($attributeEditorVisible);
- }
-
-